package com.itheima_01;

import java.util.Scanner;

public class AnimalDemo {
    public static void main(String[] args) {
/*
        Cat a=new Cat();
        a.setName("哈士奇");
        a.setAge(12);
        System.out.println(a.getName()+"-"+a.getAge());
        a.catchMouse();

*/StringBuilder s=new StringBuilder();
        Scanner sc=new Scanner(System.in);
        System.out.println("请输入一个小数：");
       double num = methodArry(sc.nextDouble());
        System.out.println(num);
            }

    public static double methodArry(double num) {
        if(num<0){

            return num*-1.0;
        }else {
            return num;
        }

    }

}
